package cn.tedu.egarticle.base.config;

import cn.tedu.egarticle.base.interceptors.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class IntreceptorConfig implements WebMvcConfigurer {
    public void addInterceptors(InterceptorRegistry registry) {
        //登录状态拦截器
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/v1/user/**")
                .excludePathPatterns("/v1/user/login");
    }
}
